package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.entity.AlertRule;
import com.zzyl.vo.AlertRuleVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface AlertRuleMapper {
    void createAlertRule(AlertRule alertRule);

    Page<AlertRuleVo> getPage(String alertRuleName, String functionName, String productKey);
    @Select("select * from alert_rule where id = #{id}")
    AlertRuleVo getAlertRuleVo(Long id);

    void updateAlertRuleVo(AlertRule alertRule);
    @Delete("DELETE FROM alert_rule where id = #{id}")
    void deleteAlertRuleVo(Long id);

    List<AlertRuleVo> getAlertRuleVoAll(@Param("functionId") String functionId,@Param("iotId") String iotId,@Param("productKey") String productKey);
}
